#define  _CRT_SECURE_NO_WARNINGS



#include<stdio.h>
#include<string.h>


int main()
{
    char a[100] = { 0 }, b[100] = { 0 };
    while (scanf("%s %s", a, b) != EOF)
    {
        int flag = 0, j = 0, temp = 0, len_a = strlen(a), len_b = strlen(b), i = 0, k = 0;
        for (i = 0; i < len_a; i++)
        {
            flag = 1;
            if (a[i] == b[0])
            {
                for (j = 0, k = i; j < len_b; j++, k++)
                {
                    if (a[k] != b[j])
                    {
                        flag = 0;
                        break;
                    }
                }
                if (flag == 1)
                {
                    printf("%d\n", i + 1);
                    temp = 1;
                    break;
                }
            }
        }
        if (temp == 0)
            printf("0\n");
    }

    return 0;
}